<?php
/* -------------------------------------------------------------------------------------
* 	ID:						$Id: soccer.php 11 2013-09-21 11:43:11Z phone.mueller@googlemail.com $
* 	Letzter Stand:			$Revision: 11 $
* 	zuletzt geaendert von:	$Author: siekiera $
* 	Datum:					$Date: 2013-09-21 11:43:11 +0000 (Sat, 21 Sep 2013) $
*
* 	SEO:mercari by Siekiera Media
* 	http://www.seo-mercari.de
*
* 	Copyright (c) since 2011 SEO:mercari
* --------------------------------------------------------------------------------------
* 	based on:
* 	(c) 2000-2001 The Exchange Project  (earlier name of osCommerce)
* 	(c) 2002-2003 osCommerce - www.oscommerce.com
* 	(c) 2003     nextcommerce - www.nextcommerce.org
* 	(c) 2005     xt:Commerce - www.xt-commerce.com
*
* 	Released under the GNU General Public License
* ----------------------------------------------------------------------------------- */
?>
<style type="text/css">
	form.soccer {padding: 6px}
	.bundesligatabelle, .spieltag {width: 100%; background: #fff}
	.bundesligatabelle td, .spieltag td {padding: 2px;}
	.bundesligatabelle tr.tr0 {background: #C0C0C0}
	.bundesligatabelle tr.tr1 {background: #FFEFAF}
	.bundesligatabelle tr.tr1 td {width: 20px}
	.bundesligatabelle tr.tr2 {background: #FFF8B8}
	.bundesligatabelle tr.tr3 {background: #FFF8B8}
	.bundesligatabelle tr.tr4-5 {background: #DDF0DD}
	.bundesligatabelle tr.tr6-15 {background: #fff}
	.bundesligatabelle tr.tr16-18 {background: #FFEEEE}
</style>

<?php
	$liga = (isset($_GET['liga']) ? $_GET['liga'] : '1');
	$sp_id = (isset($_GET['sp_id']) ? $_GET['sp_id'] : '0');
?>
<form class="soccer" name="soccer" action="start.php?liga=<?php echo $liga ?>&sp_id=<?php echo $sp_id; ?>">
<div style="margin-bottom: 10px"><strong style="font-size:1.2em;"><?php echo $liga ?>. Bundesliga</strong></div>
<?php	
	$tmp_data = file_get_contents('http://www.qualitos.de/fussball/'.$liga.'-bundesliga-tabelle.php');
	$mark = ("'<table[^>]*>.*?</table>'si");
	preg_match($mark, $tmp_data, $matches);
	echo $matches[0];

	$tmp_day = file_get_contents('http://www.qualitos.de/fussball/'.$liga.'-bundesliga-spieltage.php?sp_id='.$sp_id);
	$mark = ("'<strong[^>]*>.*?</table>'si");
	preg_match($mark, $tmp_day, $matches);
	
	for($i= 1; $i < 34; $i++)
		$c .= '<option value="'.$i.'"'.($sp_id == $i ? ' selected=""':'').'>'.$i.'. Spieltag</option>';
	
	echo '<br />';
	$match = preg_replace("'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'", '', $matches[0]);
	echo preg_replace("'</strong>'", "</strong> <span><select id=\"sp_id\" name=\"sp_id\">".$c."</select></span>", $match);
	?>
</form>
